package com.jstorm.count.mapper.linkroad;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: common
 * @Package: com.jstorm.count.mapper.network
 * @ClassName: NetworkMapper
 * @Description:
 * @Author: Mr_hu
 * @CreateDate: 2018/12/28 18:34
 * ***********************************************************
 * @UpdateUser: Mr_hu
 * @UpdateDate: 2018/12/28 18:34
 * @UpdateRemark: The modified content
 * @Version: 1.0
 * ***********************************************************
 * Copyright: Copyright (c) 2018
 **/
@Mapper
public interface LinkroadMapper {

    /**
     * 查询数量
     * @return
     */
 @Select( "select * from (select  table_name as metadataName  ,num_rows as metadataCount from all_tables \n" +
         "       WHERE  table_name LIKE  '%T_WB%' ORDer by num_rows desc)\n" +
         "       where  metadataName='T_WB_8021QVLAN'or metadataName='T_WB_CISCOPPP' or metadataName='T_WB_ETHV2'or metadataName='T_WB_FRF11'\n" +
         "       or metadataName='T_WB_FRF12'or metadataName='T_WB_FRF16'or metadataName='T_WB_FRF17'or metadataName='T_WB_IEEE8023'\n" +
         "       or metadataName='T_WB_IPCP'or metadataName='T_WB_LCP_4213'or metadataName='T_WB_LLC'or metadataName='T_WB_NONSTAINSREG'\n" +
         "              or metadataName='T_WB_PPP'or metadataName='T_WB_SDMFP'or metadataName='T_WB_SNAP'or metadataName='T_WB_X25INSREG'")
    List<Map<String, Object>>  selectLinkroadCount();

    /**
     * 查询总数
     * @return
     */
    @Select("select sum(metadataCount) as Total_count,'链路层特征采集处理服务'as Total_name   from (select  table_name as metadataName  ,num_rows as metadataCount from all_tables \n" +
            "       WHERE  table_name LIKE  '%T_WB%' ORDer by num_rows desc)\n" +
            "       where  metadataName='T_WB_8021QVLAN'or metadataName='T_WB_CISCOPPP' or metadataName='T_WB_ETHV2'or metadataName='T_WB_FRF11'\n" +
            "       or metadataName='T_WB_FRF12'or metadataName='T_WB_FRF16'or metadataName='T_WB_FRF17'or metadataName='T_WB_IEEE8023'\n" +
            "       or metadataName='T_WB_IPCP'or metadataName='T_WB_LCP_4213'or metadataName='T_WB_LLC'or metadataName='T_WB_NONSTAINSREG'\n" +
            "              or metadataName='T_WB_PPP'or metadataName='T_WB_SDMFP'or metadataName='T_WB_SNAP'or metadataName='T_WB_X25INSREG'")
    List<Map<String, Object>>   selectLinkroadTotal();

}
